/*
 * File Name: KeysManager.java
 *
 * Description: 
 *
 * Copyright @ 2005 Thomson Healthcare Inc. All Rights Reserved.
 */

package org.turbobytes.unikey.generator.table;

public class KeysManager {

  long lastValue;

  long currentValue;

  long incrementBy;

  public KeysManager(long incrementBy) {
    this.incrementBy = incrementBy;
  }

  public long getCurrentValue() {
    return currentValue;
  }

  public void setCurrentValue(long currentValue) {
    this.currentValue = currentValue;
  }

  public long getLastValue() {
    return lastValue;
  }

  public void setLastValue(long lastValue) {
    this.lastValue = lastValue;
  }

  public boolean hasMoreKeys() {
    if ((currentValue + incrementBy) > lastValue) {
      return false;
    }
    return true;
  }

  public long getNextKey() {
    currentValue = currentValue + incrementBy;
    return currentValue;
  }

}
